package com.zsc.newbuds.controller.admin;

import com.zsc.newbuds.entity.Record;
import com.zsc.newbuds.entity.SaleRecord;
import com.zsc.newbuds.service.impl.RecordServiceImpl;
import com.zsc.newbuds.service.impl.SaleRecordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 已处理的所有记录控制器
 * @author D
 */
@Controller
@RequestMapping("admin/processedRecords/")
public class ProcessedRecordsController {

    @Autowired
    RecordServiceImpl recordService;

    @Autowired
    SaleRecordServiceImpl saleRecordService;

    @ResponseBody
    @GetMapping("getSoldList")
    public List<SaleRecord> getSoldList(){
        return saleRecordService.getSaleRecordList();
    }

    @ResponseBody
    @GetMapping("getDonateList")
    public List<Record> getDonateList(){
        return recordService.getDonateList();
    }
}
